/**
 * Created by PengWei on 2018/7/17.
 */
namespace mengdao {
    export class ObjectProcessor {

        private _handlers:ObjectHandler[] = [];

        public addObjectHandler(matcher:IMatcher,handler:Function):void{
            this._handlers.push(new ObjectHandler(matcher,handler));
        }

        public processObject(object:any):void{
            this._handlers.forEach((handler:ObjectHandler)=>{
                handler.handle(object);
            });
        }

        public removeAllHandlers():void{
            this._handlers = [];
        }

    }
}